/**
 * 阶乘
 * @param num
 * @returns {*}
 *
 */
function factorialize(num) {
    if(num>0){
        for(var i=num-1; i>=1; i--){
            num *= i;
        }
    }else {
        num = 1;
    }
    return num;
}


factorialize(5);
console.log(factorialize(5));

